<div class="bg-light lter b-b wrapper-md ng-scope">
    <h4 class="m-n font-thin">SKU管理</h4>
</div>
<div class="wrapper-md ng-scope" ng-controller="skuCtrl">

    <!-- sku 添加弹窗 -->
    <script type="text/ng-template" id="skuPopupAdd.html">
        <div ng-include="'tpl/sku/sku_popup_add.html'"></div>
    </script>

    <!-- sku 删除弹窗 -->
    <script type="text/ng-template" id="skuPopupDelete.html">
        <div ng-include="'tpl/sku/sku_popup_delete.html'"></div>
    </script>

    <!-- sku 批量删除弹窗 -->
    <script type="text/ng-template" id="skuPopupBatchDelete.html">
        <div ng-include="'tpl/sku/sku_popup_ batch_delete.html'"></div>
    </script>

    <!-- sku 更新弹窗 -->
    <script type="text/ng-template" id="skuPopupEdit.html">
        <div ng-include="'tpl/sku/sku_popup_edit.html'"></div>
    </script>


    <div class="panel">
        <div class="row wrapper">
            <div class="col-sm-9">
                <form class="form-inline">
                    <div class="form-group">
                        <label class="control-label">SKU名称</label>
                        <input type="text" class="input-sm form-control" placeholder="SKU名称" ng-model="name">
                    </div>
                    <button class="btn btn-sm btn-default" ng-click="query(name)">查询</button>
                </form>
            </div>
            <div class="col-sm-3">
                <div class=" pull-right">
                    <button class="btn btn-sm btn-info" ng-click="openAddSku()">添加SKU类型</button>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="table-responsive">
            <table class="table table-striped b-t b-light">
                    <thead>
                        <tr>
                            <th>SKU名称</th>
                            <th width="200">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                         <tr ng-repeat="item in list" ng-init="initSelect()">
                            <td ng-model="item.show" ng-init="item.show=false">
                                <span ng-if="!item.show" class="block">{{item.name}}</span>
                                <input  ng-if="item.show" class="panel-heading w-full fa-border b-success" type="text" ng-model="item.name" required>
                            </td>
                            <td class="t-btns">
                                <button class="btn btn-sm btn-info" ng-click="openUpdateSku(item.id,item.name)">修改</button>
                                <button class="btn btn-sm btn-danger" ng-click="openDeleteSku(item.id,item.name)">删除</button>
                                <button class="btn btn-sm btn-success"  ui-sref="app.skuDetailInfo({skuId:item.id})">规格管理</button>

                            </td>
                         </tr>

                    </tbody>


            </table>
            <div ng-if="list.length<=0 && !app.loading" class="padder-v text-center">
                <span class="h6">~未搜索到任何数据~</span>
            </div>
            <div>
                <circle-loading ng-if="app.loading"></circle-loading>
            </div>
        </div>
        <footer class="panel-footer">
            <div class="row">
                <div class="col-sm-offset-4 col-sm-4 text-center">
                    <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共 {{totalItems}} 项</small>
                </div>
                <div class="col-sm-4 text-right text-center-xs">
                    <pagination boundary-links="true" total-items="totalItems" ng-model="currentPage"
                                ng-change="pageChanged()" max-size="{{maxPageRow}}" class="pagination-sm m-t-none m-b"
                                previous-text="上一页" next-text="下一页"
                                first-text="首页" last-text="尾页"></pagination>
                </div>
            </div>
        </footer>
    </div>

</div>
